package com.dtx.iterator.myself;

import com.dtx.iterator.gongyongde.Book;
import com.dtx.iterator.gongyongde.Iterator;


public class MyIteratorMain {

    public static void main(String[] args) {
        MyBookShelf myBookShelf = new MyBookShelf(4);
        myBookShelf.appendBook(new Book("Around the World in 80 Days"));
        myBookShelf.appendBook(new Book("Bible"));
        myBookShelf.appendBook(new Book("Cinderella"));
        myBookShelf.appendBook(new Book("Daddy-Long-Legs"));
        Iterator it = myBookShelf.iterator();
        while (it.hasNext()) {
            Book book = (Book) it.next();
            System.out.println(book.getName());
        }
    }
}
